package com.appcheck.recording.action.impl;

import org.json.JSONException;
import org.json.JSONObject;

import com.appcheck.recording.action.AbstractAction;
import com.appcheck.recording.action.ActionConvert;
import com.appcheck.recording.handler.AbstractActionHandler;
import com.appcheck.recording.plugin.AbstractActionConverter;

public class OrientationChangeAction implements AbstractAction, ActionConvert{
	private int orientation;

	public final int getOrientation() {
		return orientation;
	}

	public final void setOrientation(int orientation) {
		this.orientation = orientation;
	}

	@Override
	public String toString() {
		JSONObject localJSONObject = new JSONObject();
		try{
			localJSONObject.put("class", "OrientationChangeAction");
			localJSONObject.put("orientation", this.orientation);
		}catch(JSONException localJSONException){}
		return localJSONObject.toString();
	}

	@Override
	public boolean handle(AbstractActionHandler param) {
		return param.visit(this);
	}

	@Override
	public void toTestCode(AbstractActionConverter actionConverter) {
		actionConverter.convert(this);
		
	}
	
}
